<?php

/**
 * PublisherArtist form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BasePublisherArtistForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'publisher_artist_id' => new sfWidgetFormInputHidden(),
      'publisher_id'        => new sfWidgetFormPropelChoice(array('model' => 'Publisher', 'add_empty' => false, 'key_method' => 'getAccountId')),
      'artist_id'           => new sfWidgetFormPropelChoice(array('model' => 'Artist', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'publisher_artist_id' => new sfValidatorPropelChoice(array('model' => 'PublisherArtist', 'column' => 'publisher_artist_id', 'required' => false)),
      'publisher_id'        => new sfValidatorPropelChoice(array('model' => 'Publisher', 'column' => 'account_id')),
      'artist_id'           => new sfValidatorPropelChoice(array('model' => 'Artist', 'column' => 'artist_id')),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'PublisherArtist', 'column' => array('publisher_id', 'artist_id')))
    );

    $this->widgetSchema->setNameFormat('publisher_artist[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PublisherArtist';
  }


}
